<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of fevalImages</title>
  <meta name="keywords" content="fevalImages">
  <meta name="description" content="Used to apply the same operation to all images in given directory.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html matlab -->
<h1>fevalImages
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Used to apply the same operation to all images in given directory.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function X = fevalImages( fHandle, prms, srcDir, name, ext,nStr, nEnd, nDigits ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Used to apply the same operation to all images in given directory.

 For each image in  srcDir, loads the image, applies the function in
 fHandle and stores the result.  The result x=fHandle(I,prms{:}) on the
 ith image is stored in X(:,...:,i).  If the size of x depends on the size
 of I, then all images in the directory must have the same size.  Also I
 may have a different format depending on how it is stored on disk -
 example: MxN for grayscale, MxNx3 for RGB, MxNx4 for CMYK. This function
 is similar to fevalArrays, except instead of operating on images in
 memory it operates on images on disk.  For long operations shows progress
 info.

 The srcDir must contain nothing but images.  Either the images follow no
 naming convention, or they follow a very rigid naming convention that
 consists of a string followed by an nDigits number specifying the image
 number, followed by an extension.  The advantage of the more rigid naming
 convention is that it allows a certain range of images to be operated on,
 specified by [nStr,nEnd]. For example, to operate on images
 &quot;rats0003.tif ... rats0113.tif&quot; in directory '../rats/' use:
  fevalImages( fHandle, prms, '../rats/', 'rats' , 'tif', 3, 113, 4 );
 If the parameter name is specified ('rats' in the example above), the
 rigid naming convention is assumed.  All further input arguments are
 optional. imwrite2 writes images in the format described above.

 A limitation of fevalImages is that it does not pass state information
 to fHandle.  For example, fHandle may want to know how many times it's
 been  called. This can be overcome by saving state information inside
 fHandle using 'persistent' variables.  For an example see imwrite2 (which
 uses persistent variables with fevalArrays).

 USAGE
  X = fevalImages( fHandle, prms, srcDir, [name], [ext],
                    [nStr], [nEnd], [nDigits] )

 INPUTS
  fHandle   - function to apply to each image [see above]
  prms      - cell array of additional parameters to fHandle (may be {} )
  srcDir    - directory containing images
  name      - [] base name of images
  ext       - [] extension of image
  nStr      - [] image number on which to start
  nEnd      - [] image number on which to end
  nDigits   - [] number of digits for filename index

 OUTPUTS
  X        - output array [see above]

 EXAMPLE
  % reads in all images in directory (note that fHandle is identity):
  X = fevalImages( @(x) x, {}, srcDir );
  % reads in different sized images into cell array:
  X = fevalImages( @(x) {x}, {}, srcDir );
  % reads in all images converting to grayscale:
  X = fevalImages( @(x) rgb2gray(x), {}, srcDir );

 See also <a href="fevalArrays.html" class="code" title="function B = fevalArrays( A, fHandle, varargin )">FEVALARRAYS</a>, IMWRITE2, PERSISTENT, <a href="ticStatus.html" class="code" title="function id = ticStatus( msg, updateFreq, updateMinT, erasePrev )">TICSTATUS</a>

 Piotr's Computer Vision Matlab Toolbox      Version 2.40
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
